<template>
    <div>
        <van-search v-model="value" show-action label="地址" placeholder="请输入搜索关键词" @search="onSearch">
            <template #action>
                <div @click="onClickButton">搜索</div>
                <van-cell-group v-for="item in qsearch">
                    <van-cell title="单元格" value="内容"/>
                </van-cell-group>
            </template>
</van-search>
        <!-- <van-search v-model="value" placeholder="请输入搜索关键词" />
        <van-cell-group v-for="item in qsearch">
            <van-cell title="单元格" value="内容" />
        </van-cell-group> -->
    </div>
</template>

<script setup>
import { ref, watch, } from 'vue';
import { qsearchApi } from '@/api/api'
const qsearch = ref([])
const value = ref()
watch(value, (we) => {
    qsearchApi(we).then(res => {
        console.log('搜索数据', res);
        qsearch.value = res.data.message
    })
})
</script>

<style lang="scss" scoped></style>